import { createRouter, createWebHistory } from "vue-router";
import Home from "../views/Home.vue";
import Search from "../views/Search.vue";
import WordBooks from "../views/WordBooks.vue";
import Login from "../views/Login.vue";
import User from "../views/User.vue";
import Test from "../views/test.vue";
import TestStart from "../views/testStart.vue";
import wordList from "../views/wordList.vue";
import UploadPdf from "../views/UploadPdf.vue";
import Root from "../views/Root.vue";
import Profile from "../views/Profile.vue";
import ExtendArticle from "../views/ExtendArticle.vue";
import ExtendArticleDetail from "../views/ExtendArticleDetail.vue";
import Etymology from "../views/Etymology.vue";
import EtymologyDetail from "../views/EtymologyDetail.vue";
import Cart from "../views/Cart.vue";

const routes = [
	{
		path: "/",
		name: "Login",
		component: Login,
	},
	{
		path: "/login",
		name: "login",
		component: Login,
	},
	{
		path: "/home",
		name: "Home",
		component: Home,
	},
	{
		path: "/search",
		name: "Search",
		component: Search,
	},
	{
		path: "/wordBooks",
		name: "WordBooks",
		component: WordBooks,
	},
	{
		path: "/user",
		name: "user",
		component: User,
	},
	{
		path: "/root",
		name: "root",
		component: Root,
	},
	{
		path: "/test",
		name: "test",
		component: Test,
	},
	{
		path: "/testStart",
		name: "testStart",
		component: TestStart,
	},
	{
		path: "/wordList",
		name: "wordList",
		component: wordList,
	},
	{
		path: "/UploadPdf",
		name: "UploadPdf",
		component: UploadPdf,
	},
	{
		path: "/Profile",
		name: "Profile",
		component: Profile,
	},
	{
		path: "/extendArticle",
		name: "ExtendArticle",
		component: ExtendArticle,
	},
	{
		path: "/extendArticleDetail",
		name: "ExtendArticleDetail",
		meta: {
			hidden: true,
		},
		component: () => import("../views/ExtendArticleDetail.vue"),
	},
	{
		path: "/etymology",
		name: "Etymology",
		component: Etymology,
	},
	{
		path: "/etymologyDetail",
		name: "EtymologyDetail",
		component: EtymologyDetail,
	},
	{
		path: "/cart",
		name: "Cart",
		component: Cart,
	},
	{
		path: "/category",
		name: "Category",
		component: () => import("@/views/Category.vue"),
	},
	{
		path: "/product",
		name: "Product",
		component: () => import("@/views/Product.vue"),
	},
	{
		path: "/shop",
		name: "Shop",
		component: () => import("@/views/Shop.vue"),
	},
	{
		path: "/position",
		name: "Position",
		component: () => import("@/views/Position.vue"),
	},
	{
		path: "/order",
		name: "Order",
		component: () => import("@/views/Order.vue"),
	},
	{
		path: "/publicExtendActicle",
		name: "PublicExtendActicle",
		component: () => import("@/views/PublicExtendActicle.vue"),
	},
	{
		path: "/watchWordBook",
		name: "WatchWordBook",
		component: () => import("@/views/WatchWordBook.vue"),
	},
];

const router = createRouter({
	history: createWebHistory(process.env.BASE_URL),
	routes,
});

export default router;
